home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 8380 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.0 KB

  1. Path: inferno.mpx.com.au!news
  2. From: Malcolm Smith <mjsmith@mpx.com.au>
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: help with conversion subroutine
  5. Date: 17 Feb 1996 14:04:13 GMT
  6. Organization: Microplex Pty Ltd
  7. Message-ID: <4g4n8t$bsg@inferno.mpx.com.au>
  8. References: <4ffsgm$mkl@mozo.cc.purdue.edu>
  9. NNTP-Posting-Host: dialup-261.mpx.com.au
  10.  
  11. Mark Kelsey <kelsey> wrote:
  12. >
  13. > I have an assignment that requires me to convert any number (base 2 to 16) to a
  14. > number in a different base (again 2 to 16).  I like to program but math is
  15. > deffinately a weak area.  If anyone can help, please post or mail to
  16. > kelsey@elmail.purdue.edu
  17. > Thanks
  18. > Kelse
  19.                             log b
  20.                                c
  21. The conversion is   log b = ------
  22.                        a    log a
  23.                                c
  24.  
  25. This converts log b (base a) to an equivalent in base 10.
  26.  
  27. eg.,  log 8 = 3      because 2^3 = 8.
  28.          2
  29.  
  30. Let's change to base 10
  31.  
  32.               log  8
  33.                  10
  34.       log 8 = ------
  35.          2    log  2
  36.                  10
  37.  
  38.  
  39.